﻿Public Class ImagePreviewForm
    Private ImgObj As Image

    Private Sub pbImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbImage.Click
        Me.Close()
    End Sub

    Private Sub LoadImage()
        pbImage.Image = ImgObj
        Me.Width = ImgObj.Width
        Me.Height = ImgObj.Height
    End Sub

    Public Sub New(ByVal Img As Image)
        ' This call is required by the designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
        ImgObj = Img
        LoadImage()
    End Sub
End Class